<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>管理员列表 - 权限管理</title>
	</head>
	<body>
		<table border="1" width="80%">
			<tr>
				<td>序号</td>
				<td>角色</td>
				<td>邮箱</td>
				<td>手机</td>
				<td>真实姓名</td>
				<td>状态</td>
				<td>创建时间</td>
				<td>更新时间</td>
				<td>上次登陆时间</td>
			</tr>
			<c:forEach items="${requestScope.adminsList }" var="admins" varStatus="stat">
				<tr style="background: ${stat.count % 2 == 0 ? 'blue' : ''}">
					<td>${stat.count }</td>
					<td>${admins.role.name }</td>
					<td title="${admins.email }">
						${admins.email }<br/>
						<c:set value="${fn:indexOf(admins.email, '@')}" var="index"/>
						<c:set value="${fn:length(admins.email)}" var="totalLength"/>
						${fn:substring(admins.email , 0, index - 3)}***${fn:substring(admins.email , index,totalLength)}
					</td>
					<td>${admins.phone }</td>
					<td>${admins.trueName }</td>
					<td>${admins.status }</td>
					<td><fmt:formatDate value="${admins.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td><fmt:formatDate value="${admins.updateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td><fmt:formatDate value="${admins.lastLoginTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				</tr>
			</c:forEach>
		</table>
	</body>
</html>